home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH4 / 4-1-1.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1998-09-18  |  1.7 KB  |  58 lines

  1. VERSION 5.00
  2. Begin VB.Form frm4_1_1 
  3.    Caption         =   "Arithmetic"
  4.    ClientHeight    =   1785
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   3720
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   1785
  20.    ScaleWidth      =   3720
  21.    Begin VB.PictureBox picResult 
  22.       Height          =   855
  23.       Left            =   120
  24.       ScaleHeight     =   795
  25.       ScaleWidth      =   3435
  26.       TabIndex        =   1
  27.       Top             =   720
  28.       Width           =   3495
  29.    End
  30.    Begin VB.CommandButton cmdAdd 
  31.       Caption         =   "Add Numbers"
  32.       Height          =   375
  33.       Left            =   600
  34.       TabIndex        =   0
  35.       Top             =   120
  36.       Width           =   2415
  37.    End
  38. Attribute VB_Name = "frm4_1_1"
  39. Attribute VB_GlobalNameSpace = False
  40. Attribute VB_Creatable = False
  41. Attribute VB_PredeclaredId = True
  42. Attribute VB_Exposed = False
  43. Private Sub cmdAdd_Click()
  44.   Dim num1 As Single, num2 As Single
  45.   'Display the sum of two numbers
  46.   picResult.Cls
  47.   Call ExplainPurpose
  48.   picResult.Print
  49.   num1 = 2
  50.   num2 = 3
  51.   picResult.Print "The sum of"; num1; "and"; num2; "is"; num1 + num2
  52. End Sub
  53. Private Sub ExplainPurpose()
  54.   'Explain the task performed by the program
  55.   picResult.Print "This program displays a sentence"
  56.   picResult.Print "identifying two numbers and their sum."
  57. End Sub
  58.